/**
 * Created by Jancheng on 2017/9/13.
 */
/**
 * 获取浏览器版本
 */
/*import exif from "exif-js"
import http from '@/utils/httpClient'
import config from '@/config/index';*/

/**
 * 获取浏览器版本
 * @returns {{trident: boolean, presto: boolean, webKit: boolean, gecko: boolean, mobile: boolean, ios: boolean, android: boolean, iPhone: boolean, iPad: boolean, webApp: boolean, qtClient: boolean, userAgent: string}}
 */
function getBrowserVersions(){
  var u = navigator.userAgent,app = navigator.appVersion;
  return {
    trident: u.indexOf('Trident') > -1, //IE内核
    presto: u.indexOf('Presto') > -1, //opera内核
    webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
    gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
    mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
    ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
    android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
    iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者QQHD浏览器
    iPad: u.indexOf('iPad') > -1, //是否iPad
    webApp: u.indexOf('Safari') == -1 ,//是否web运用程序，没有头部与底部
    qtClient: u.indexOf('Qingtui')> -1 ,//轻推客户端
    userAgent:u
  };
}




function getObjectTextCount(id) {
 if(id!=undefined&&id!=null&&document.getElementById(id)){
   return document.getElementById(id).innerText.length;
 }else{
   return 0;
 }
}

/**
 * 检查Dom Text 与Max大小
 * @param id
 * @param max
 */

export default {
  getBrowserVersions,
  getObjectTextCount,

};
